<script setup>
const props = defineProps({
  modelValue: {
    type: String,
    default: ''
  },
  placeholder: {
    type: String,
    default: '请选择考试难度'
  },
  allowClear: {
    type: Boolean,
    default: true
  }
})

const emit = defineEmits(['update:modelValue'])

const difficulty = [
  { value: '0.1', label: '0.1' },
  { value: '0.2', label: '0.2' },
  { value: '0.3', label: '0.3' },
  // 可以继续添加更多难度选项
  { value: '0.4', label: '0.4' },
  { value: '0.5', label: '0.5' } ,
  { value: '0.6', label: '0.6' },
  { value: '0.7', label: '0.7' },
  { value: '0.8', label: '0.8' },
  { value: '0.9', label: '0.9' },
  { value: '1.0', label: '1.0' },
]

const handleChange = (value) => {
  emit('update:modelValue', value)
}
</script>

<template>
  <a-select
      :placeholder="placeholder"
      :allow-clear="allowClear"
      @change="handleChange"
  >
    <a-option
        v-for="item in difficulty"
        :key="item.value"
        :value="item.value"
        :label="item.label"
    />
  </a-select>
</template>

<style scoped>
/* 可根据需要添加样式 */
</style>